<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title></title>
    <style type="text/css">
		.checkbox{
			 margin-left:5px;
			 width:90px;
			 margin-top: 10px;
		}
		textarea{
			width: 300px;
			height: 100px;
		}
    </style>
    <link rel="stylesheet" type="text/css" href="http://127.0.0.1/juanpi/Static/Admin/hdjs/hdjs.css"/>
    <script type="text/javascript" charset="utf-8" src="http://127.0.0.1/juanpi/Static/Admin/ueditor1_4_3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="http://127.0.0.1/juanpi/Static/Admin/ueditor1_4_3/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="http://127.0.0.1/juanpi/Static/Admin/ueditor1_4_3/lang/zh-cn/zh-cn.js"></script>   
    <script src="http://127.0.0.1/juanpi/Static/Admin/js/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
    	$(function(){
    		//点击x 删除图片
    		$('.close').click(function(){
    			//父级td
    			var td = $(this).parents('td');
    			//获得完整路径
    			var path = $(this).attr('path');
    			//获得对应的aid
    			var bid = $(this).attr('bid');
    			$.ajax({
    				type:"post",
    				url:"<?php echo U('delImg');?>",
    				data:{path : path,bid : bid},
    				success:function(){
    					td.find('img').hide();
    					//组合input字符串
    					var str = '<input type="file" name="logo" id="" />';
    					td.html(str);
    				}
    			});
    		})
    	})
    </script>
</head>
<body>
<div class="wrap">
    <div class="hd-title-header">编辑轮播图</div>
    <form action="" method="post" class="form-inline hd-form" enctype="multipart/form-data">
        <table class="hd-table hd-table-list">
            <tr>
                <th class="w100">图片地址</th>
                <td class="w100">
                    <input type="text" name="url" class="w200" value="<?php echo $oldData['url'];?>"/> 
                </td>
                <td></td>
            </tr>
           
            <tr>
                <th class="w100">logo</th>
                <td>
                	<!--如果有图片的时候-->
                	    <?php if($oldData['logo']){ ?>
                		<!--http://127.0.0.1/juanpi是图片网络地址-->
                		<img src="http://127.0.0.1/juanpi/<?php echo $oldData['logo'];?>" alt="" style="width: 200px;"/>
                		<a href="javascript:;" style="color:red;" class="close" path="<?php echo $oldData['logo'];?>" bid="<?php echo $oldData['bid'];?>">X</a>
                		<input type="hidden" name="logo" value="<?php echo $oldData['logo'];?>"/>
                	<?php }else{ ?>
						<input type="file" name="logo" id="" />
					<?php } ?>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">图片排序</th>
                <td class="w100">
                    <input type="text" name="sort" class="w200" value="<?php echo $oldData['sort'];?>"/> 
                </td>
                <td></td>
            </tr>
        </table>
        <div class="position-bottom">
            <input type="submit" class="hd-btn hd-btn-primary hd-btn-sm" value="修改"/>
        </div>
    </form>
</div>
</body>
</html>